package com.ihr360.expr.operator;

import com.ihr360.expr.ExprException;
import com.ihr360.expr.context.IEvaluationContext;
import com.ihr360.expr.core.AbstractComparisonOperator;
import com.ihr360.expr.core.Expr;
import com.ihr360.expr.core.ExprType;

public class ExprLessThan extends AbstractComparisonOperator
{
    public ExprLessThan(Expr lhs, Expr rhs) {
        super(ExprType.LessThan, lhs, rhs);
    }

    public Expr evaluate(IEvaluationContext context) throws ExprException {
        return bool(compare(context) < 0);
    }

    public String toString() {
        return lhs + "<" + rhs;
    }
}